package com.miniotest.config;

import net.bramp.ffmpeg.FFmpeg;
import net.bramp.ffmpeg.FFprobe;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * ffmpeg程序路径配置
 */
@Component
public class FFMpegConfig {
    @Value("${spring.ffmpeg.ffmpeg}")
    private String ffmpegPath;
    @Value("${spring.ffmpeg.ffprobe}")
    private String ffprobePath;

    @Bean
    public FFmpeg ffmpeg() throws IOException {
        return new FFmpeg(ffmpegPath);
    }
    @Bean
    public FFprobe fFprobe() throws IOException{
        return new FFprobe(ffprobePath);
    }
}
